package ysq.xyg.web.model.po;

import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 业务模块-用户账单记录实体类
 *
 * @author congcong tao
 * @date 2020-1-11 19:03:23
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_web_score_record")
public class WebScoreRecord implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;

	/**
     * 会员主键
     */ 
	@Column(name = "member_id")
	private String memberId;

	/**
     * 得分
     */ 
	@Column(name = "score")
	private String score;

	/**
     * 类型
	 * 1=推荐获取佣金2=佣金提现
     */ 
	@Column(name = "record_type")
	private String recordType;

	/**
     * 描述
     */ 
	@Column(name = "descripts")
	private String descripts;

	/**
     * 外键
     */ 
	@Column(name = "extra_id")
	private String extraId;

	/**
     * 删除状态1、未删除2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 创建者
     */ 
	@Column(name = "create_user")
	private String createUser;

	/**
     * 更新者
     */ 
	@Column(name = "update_user")
	private String updateUser;

	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 更新时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	@Transient
	private String memberNickName;

	@Transient
	private String startDate;

	@Transient
	private String endDate;

	public WebScoreRecord(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}